home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / doom / axxwar_1.zip / SOURCES / TRACERAM.QC < prev    next >
Text File  |  1997-03-12  |  2KB  |  90 lines

  1. // AxxWars Release v1.0
  2. // TracerAmmo.qc
  3. // One in five nails fired by the Perforator is a tracer.
  4.  
  5. /*
  6. ============
  7. Tracer_Touch
  8. ============
  9. */
  10. void() Tracer_Touch =
  11. {
  12.     local vector org;
  13.     
  14.     if (other.solid == SOLID_TRIGGER)
  15.           {       
  16.              return;
  17.             }        
  18.  
  19.     if (pointcontents(self.origin) == CONTENT_SKY)
  20.         {
  21.         remove(self);
  22.         return;
  23.         }
  24.     
  25.     if (other.takedamage)
  26.         {
  27.              spawn_touchblood (5);
  28.              T_Damage (other, self, self.owner, 5);
  29.              remove(self);
  30.              return;
  31.         }
  32.     else
  33.           {
  34.              WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  35.              WriteByte (MSG_BROADCAST, TE_SPIKE);
  36.              WriteCoord (MSG_BROADCAST, org_x);
  37.              WriteCoord (MSG_BROADCAST, org_y);
  38.              WriteCoord (MSG_BROADCAST, org_z);
  39.             }
  40.         
  41.     self.velocity = '0 0 0';
  42.     remove(self);
  43.  
  44. };
  45.  
  46. /*
  47. ============
  48. LaunchTracer
  49. ============
  50. */
  51. void(vector org, vector vec) LaunchTracer =
  52. {
  53.     local    vector    vec;
  54.         
  55.     vec = normalize(vec);
  56.     
  57.     newmis = spawn();
  58.     newmis.owner = self;
  59.     newmis.movetype = MOVETYPE_FLY;
  60.     newmis.solid = SOLID_BBOX;
  61.     newmis.effects = EF_DIMLIGHT;
  62.  
  63.     setmodel (newmis, "progs/spike.mdl");
  64.     newmis.skin = 1;
  65.     setsize (newmis, '0 0 0', '0 0 0');        
  66.  
  67.     setorigin (newmis, org);
  68.  
  69.     newmis.velocity = vec * 600;
  70.     newmis.angles = vectoangles(newmis.velocity);
  71.  
  72.       newmis.nextthink = time + 5;
  73.     newmis.think = SUB_Remove;
  74.       newmis.touch = Tracer_Touch;
  75. };
  76.  
  77. /*
  78. ===========
  79. Tracer_Fire
  80. ===========
  81. */
  82. void(vector org, vector vec) tracer_fire =
  83. {
  84.     self.effects = self.effects | EF_MUZZLEFLASH;
  85.     makevectors (self.angles);
  86.     
  87.         LaunchTracer(org, vec);
  88. };
  89.  
  90.